# -*- coding: utf-8 -*-

'''
共用函数帮助类
'''

import os
import shutil
import json
import sys
import codecs
import subprocess
import hashlib



sys.dont_write_bytecode = True





def isKeyInDic(dic,key):
	return dic.get(key)



#遍历dic1,查找dic2的值
#当为空值的时候返回
#callback:如果return ture,继续遍历,如果return false,停止遍历
def compareDic(dic1,dic2,callback,noneReturn):
	for key,val in dic1.items():
		if dic2.get(key):
			if not callback(key,val,dic2.get(key)):
				return False
		else:
			if not callback(key,val,noneReturn):
				return False
	return True



